package my.database.test.entity;

import my.dao.BaseEntity;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.ManyToOne;

/**
 * Created by xnat on 17/8/20.
 */
@Entity
public class District extends BaseEntity {
    /**
     * 名字.
     */
    private String name;
    /**
     * 行政级别.
     */
    @Enumerated(EnumType.STRING)
    private DistrictLevel level;
    /**
     * 父级
     */
    @ManyToOne
    private District parent;


    public String getName() {
        return name;
    }

    public District setName(String name) {
        this.name = name;
        return this;
    }

    public DistrictLevel getLevel() {
        return level;
    }

    public District setLevel(DistrictLevel level) {
        this.level = level;
        return this;
    }

    public District getParent() {
        return parent;
    }

    public District setParent(District parent) {
        this.parent = parent;
        return this;
    }
}
